import request from '@/utils/request';
import {OrderTrade, queryType} from "./data.d";

export async function queryFutuersList(params:queryType) {
  return request('/hk/admin/order/futuers/list', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
      'token':`${localStorage.getItem('token')}`
    },
    data:{
      debug:true,
      param:params
    }
  });
}
export async function querySymbols() {
  return request('/hk/admin/order/futuers/symbols', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
      'token':`${localStorage.getItem('token')}`
    },
    data:{
      debug:true,
    }
  });
}

export async function queryFutuersDetailList(params:queryType) {
  return request('/hk/admin/order/futuers/detail', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
      'token':`${localStorage.getItem('token')}`
    },
    data:{
      debug:true,
      param:params
    }
  });
}

export async function orderTrade(params:OrderTrade) {
  return request('/hk/admin/contractStock/order/transaciton', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
      'token':`${localStorage.getItem('token')}`
    },
    data: {  debug:true,param:params},
  });
}

export async function queryCrossProfitList() {
  return request('/hk/admin/cross/crossProfit', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
      'token':`${localStorage.getItem('token')}`
    },
  });
}
